package Runde7;

public abstract class Abteil {
	
	protected TransportierbaresTier tier;
	
	/**
	 * @precondition t != null
	 * @postcondition Loads the given animal to the partition and returns the loaded animal.
	 * 					If no animal was loaded (full, not compatible) logically null will be returned
	 */
	public abstract TransportierbaresTier abtLoad(TransportierbaresTier t);
	
	/**
	 * @postcondition - Unloads the animal inside the partition and returns it.
	 */
	public TransportierbaresTier abtUnload() {
		TransportierbaresTier temp = tier;
		tier = null;
		return temp;
	}
	
	/**
	 * @postcondition - delivers a readable form of this instance of Abteil
	 */
	public String toString() {
			return "" + tier;
	}
}
